﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


namespace Event_Planner.Filters
{

    public static class Cache
    {
        internal static string OutputCacheEventosGeneral
        {
            get
            {
                if (HttpContext.Current.Application["Cache.OutputCacheEventosGeneral"] == null)
                {
                    HttpContext.Current.Application["Cache.OutputCacheEventosGeneral"] = Guid.NewGuid().ToString();
                }
                return HttpContext.Current.Application["Cache.OutputCacheEventosGeneral"].ToString();

            }
        }


        internal static string OutputCacheEventosPropios
        {
            get
            {
                if (HttpContext.Current.Application[HttpContext.Current.User.Identity.Name +  "Cache.OutputCacheEventosPropios"] == null)
                {
                    HttpContext.Current.Application[HttpContext.Current.User.Identity.Name + "Cache.OutputCacheEventosPropios"] = Guid.NewGuid().ToString();
                }
                return HttpContext.Current.Application[HttpContext.Current.User.Identity.Name + "Cache.OutputCacheEventosPropios"].ToString();

            }
        }


        internal static void ResetOutputCache()
        {
            HttpContext.Current.Application.RemoveAll();
        }
    }
}
